<%@ Control Language="C#" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="CSD" Namespace="CommunityServer.Discussions.Controls" Assembly="CommunityServer.Discussions" %>
<%@ Import Namespace="CommunityServer.Components" %>
<%@ Import Namespace="CommunityServer.Controls" %>
<%@ Import Namespace="CommunityServer.Discussions.Components" %>
<%@ Import Namespace="CommunityServer.Discussions.Controls" %>
	
<script language="Javascript">
  function OpenWindow (target) { 
    window.open(target, "test", "toolbar=no,scrollbars=yes,resizable=yes,width=300,height=300"); 
  }
</script>

<div class="CommonContentArea">
	<div class="CommonBreadCrumbArea"><CSD:BreadCrumb ShowHome="true" runat="server" id="Breadcrumb1" /></div>
	<h2 class="CommonTitle"><CSD:InlineTextEdit runat="server" id="ForumName" /></h2>
    <div class="CommonContent">
		<div class="CommonDescription"><CSD:InlineTextEdit runat="server" id="ForumDescription" /></div>
					
		<div class="CommonFormArea">
		<table cellpadding="0" cellspacing="0" border="0" width="100%">
			<tr>
				<td align="left" class="CommonFormField">
					<CSD:ForumImageButton ButtonType="NewPost" runat="server" id="Forumimagebutton1"/>
				</td>
			</tr>
		</table>
		</div>

		<div clas="CommonListArea">
        <table cellpadding="0" cellspacing="0" border="0" width="100%">
			<thead>
				<tr>
					<th class="CommonListHeaderLeftMost" colspan="3" align="center">
						<CS:ResourceLabel runat="server" ResourceName="PrivateMessages_Messages" />
					</th>
					<th class="CommonListHeader" align="center" nowrap="true">
						<CS:ResourceLabel runat="server" ResourceName="PrivateMessages_Recipients" />
					</th>
					<th class="CommonListHeader" align="center" nowrap="true">
						<CS:ResourceLabel runat="server" ResourceName="ViewThreads_TitleReplies" />
					</th>
					<th class="CommonListHeader" align="center" nowrap="true">
						<CS:ResourceLabel runat="server" ResourceName="ViewThreads_TitleViews" />
					</th>          
					<th class="CommonListHeader" align="center" nowrap="true">
						<CS:ResourceLabel runat="server" ResourceName="ViewThreads_TitleLastPost" />
					</th>
				</tr>        
			</thead>
			<tbody>
							
			<asp:Repeater EnableViewState="False" id="Announcements" runat="server">
				<ItemTemplate>            
					<tr>
						<td align="center" class="CommonListCellLeftMost">
							<asp:checkbox id="BulkEdit" runat="server" /><span runat="server" visible="false" id="ThreadID"><%# DataBinder.Eval(Container.DataItem, "ThreadID") %></span>
						</td>                              
						<td align="center" class="ForumListCellImageOnly" nowrap="true">
							<%# ForumFormatter.StatusIcon( (Thread) Container.DataItem ) %>
						</td>
						<td class="CommonListCell">
							<table cellpadding="0" cellspacing="0" border="0">
								<tr>
									<td class="ForumSubListCellLeftMost"><%# Formatter.GetEmotionMarkup( ((Thread) Container.DataItem).EmoticonID ) %>
										<a href="<%# Globals.GetSiteUrls().Post( (int) DataBinder.Eval(Container.DataItem, "PostID") ) %> "><%# Formatter.CheckStringLength(DataBinder.Eval(Container.DataItem, "Subject").ToString(), 65) %></a> 
										<CSD:ThreadPager runat="server" ThreadID='<%# DataBinder.Eval(Container.DataItem, "PostID") %>' Replies='<%# DataBinder.Eval(Container.DataItem, "Replies") %>' />
									</td>
									<td class="ForumSubListCell">
										<CSD:RatePost IsReadOnly="true" PostID='<%# ((Thread) Container.DataItem).PostID %>' CurrentRating='<%# ((Thread) Container.DataItem).RatingAverage %>' CurrentVotes='<%# ((Thread) Container.DataItem).TotalRatings %>'  ThreadID='<%# ((Thread) Container.DataItem).ThreadID %>' Visible='<%# (CSContext.Current.SiteSettings.SectionRatingType == SectionRatingType.ThreadRating) %>' id="RateThread" runat="server" CssClass="CommonRateControl" ReadOnlyCssClass="CommonRateControlReadOnly" ActiveCssClass="CommonRateControlActive" ImagesBaseUrl="~/Themes/default/images/common/" />
										<CSD:ThreadStatusImage Thread='<%# (Thread) Container.DataItem %>' runat="server" />
									</td>
								</tr>
								<tr> 
									<td colspan="2" class="ForumSubListCellLeftMost">
										<CS:ResourceLabel runat="server" ResourceName="ForumGroupView_Legend_LastPostBy" /><%# Formatter.FormatUsername( (int) DataBinder.Eval(Container.DataItem, "AuthorID"), DataBinder.Eval(Container.DataItem, "Username").ToString() ) %>
									</td>
								</tr>
							</table>
						</td>
						<td class="CommonListCell" align="center">
							<%# ForumFormatter.FormatPrivateMessageRecipients ( (PrivateMessage) Container.DataItem ) %>
						</td>
						<td class="CommonListCell" align="center">
							<%# Formatter.FormatNumber( ((Thread) Container.DataItem).Replies ) %>
						</td>
						<td class="CommonListCell" align="center">
							<%# Formatter.FormatNumber( ((Thread) Container.DataItem).Views ) %>
						</td>
						<td class="CommonListCell" align="center">
							<%# ForumFormatter.FormatLastPost( (Thread) Container.DataItem ) %>
						</td>
					</tr>
				</ItemTemplate>
				<FooterTemplate>
					<tr>
						<td colspan="7" class="CommonListCellLeftMost">
							<asp:Button runat="server" text="Delete Checked" id="BulkDeleteButton" />
						</td>
					</tr>
				</FooterTemplate>
			</asp:Repeater>
							
			<asp:Repeater EnableViewState="False" id="Threads" runat="server">
				<ItemTemplate>            
					<tr>
						<td align="center" class="CommonListCellLeftMost">
							<asp:checkbox id="BulkEdit" runat="server" /><span runat="server" visible="false" id="ThreadID"><%# DataBinder.Eval(Container.DataItem, "ThreadID") %></span>
						</td>                         
						<td align="center" class="ForumListCellImageOnly" >
							<%# ForumFormatter.StatusIcon( (Thread) Container.DataItem ) %>
						</td>
						<td class="CommonListCell">
							<table cellpadding="0" cellspacing="0" border="0">
								<tr>
									<td class="ForumSubListCellLeftMost">
										<%# Formatter.GetEmotionMarkup( ((Thread) Container.DataItem).EmoticonID ) %>
										<a href="<%# Globals.GetSiteUrls().Post( (int) DataBinder.Eval(Container.DataItem, "PostID") ) %> ">
										<%# Formatter.CheckStringLength(DataBinder.Eval(Container.DataItem, "Subject").ToString(), 65) %>
										</a> 
										<CSD:ThreadPager runat="server" ThreadID='<%# DataBinder.Eval(Container.DataItem, "PostID") %>' Replies='<%# DataBinder.Eval(Container.DataItem, "Replies") %>' />
									</td>
									<td class="FormSubListCell">
										<CSD:RatePost IsReadOnly="true" PostID='<%# ((Thread) Container.DataItem).PostID %>' CurrentRating='<%# ((Thread) Container.DataItem).RatingAverage %>' CurrentVotes='<%# ((Thread) Container.DataItem).TotalRatings %>'  ThreadID='<%# ((Thread) Container.DataItem).ThreadID %>' Visible='<%# (CSContext.Current.SiteSettings.SectionRatingType == SectionRatingType.ThreadRating) %>' id="Ratepost1" runat="server" CssClass="CommonRateControl" ReadOnlyCssClass="CommonRateControlReadOnly" ActiveCssClass="CommonRateControlActive" ImagesBaseUrl="~/Themes/default/images/common/" />
										<CSD:ThreadStatusImage Thread='<%# (Thread) Container.DataItem %>' runat="server" />
									</td>
								</tr>
								<tr> 
									<td colspan="2" class="ForumSubListCellLeftMost">
										<CS:ResourceLabel runat="server" ResourceName="ForumGroupView_Legend_LastPostBy" /><%# Formatter.FormatUsername( (int) DataBinder.Eval(Container.DataItem, "AuthorID"), DataBinder.Eval(Container.DataItem, "Username").ToString() ) %>
									</td>
								</tr>
							</table>
						</td>
						<td class="CommonListCell" align="center">
							<%# ForumFormatter.FormatPrivateMessageRecipients ( (PrivateMessage) Container.DataItem ) %>
						</td>
						<td class="CommonListCell" align="center">
							<%# Formatter.FormatNumber( ((Thread) Container.DataItem).Replies ) %>
						</td>
						<td class="CommonListCell" align="center">
							<%# Formatter.FormatNumber( ((Thread) Container.DataItem).Views ) %>
						</td>
						<td class="CommonListCell" align="center">
							<%# ForumFormatter.FormatLastPost( (Thread) Container.DataItem ) %>
						</td>
					</tr>
				</ItemTemplate>
				<FooterTemplate>
					<tr>
						<td colspan="7" class="CommonFormField">
							<asp:Button runat="server" text="Delete Checked" id="BulkDeleteButton" />
						</td>
					</tr>
				</FooterTemplate>
			</asp:Repeater>
								
			<span id="NoThreadsToDisplay" runat="server" class="noTopics">
				<tr>
					<td colspan="7" class="CommonListCellLeftMost">
						<CS:ResourceLabel runat="server" ResourceName="ViewThreads_NoTopics" />
					</td>
				</tr>	
			</span>        
		</tbody>        
		</table>
		</div>

		<div class="CommonPagingArea" align=right>
			<CS:CurrentPage Cssclass="columnText" id="Currentpage" runat="server" />
			<CSD:ForumPager id="Pager" runat="server" />
		</div>
		
		<div class="CommonFeedArea" align=right>
			<CSD:RssLink runat="server" id="Rsslink1" NAME="Rsslink1"/>
		</div>
           
        
        <h3 class="CommonSubTitle"><CS:ResourceLabel runat="server" ResourceName="ViewThreads_PrivateMessagesOptions" id="Resourcelabel1" NAME="Resourcelabel1"/></h3>
		<table cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td align="left" class="CommonFormFieldName" nowrap="true">
					<CS:ResourceLabel runat="server" ResourceName="ViewThreads_SortedBy" />
				</td>
				<td align="left" class="CommonFormField">
					<CSD:ThreadSortDropDownList id="SortThreads" runat="server" />
					<CS:ResourceLabel runat="server" ResourceName="ViewThreads_In" /><CS:SortOrderDropDownList id="SortOrder" runat="server" />
					<CS:ResourceLabel runat="server" ResourceName="ViewThreads_OrderFrom" />
				</td>
				<td rowspan=4 class="CommonFormFieldDescription">
					<CSD:UserPermissions runat="server" id="Userpermissions"/>
				</td>
			</tr>
			<tr>
				<td align="left" class="CommonFormFieldName" nowrap="true">
					<CS:ResourceLabel runat="server" ResourceName="ViewThreads_FilterByDate" />
				</td>
				<td align="left" class="CommonFormField">
					<CS:DateFilter id="DateFilter" runat="server" AddText="false" AppendLineBreak="false" />
				</td>
			</tr>
			<!-- Future version							
			<tr>
				<td align="left" class="CommonFormFieldName" nowrap="true">
					<%= ResourceManager.GetString("ViewThreads_FilterByTopic")%>
				</td>
				<td align="left" class="CommonFormField">	
					<CSD:HideReadPostsDropDownList runat="server" id="HideReadPosts" />
					<CS:FilterUsersDropDownList runat="server" id="FilterUsers" />
				</td>
			</tr>
			<tr>
				<td align="left" class="CommonFormFieldDescription" nowrap="true">
					<%=CommunityServer.Components.ResourceManager.GetString("ViewThreads_FilterByIgnore")%>
				</td>
				<td align="left"></td>
			</tr>
			-->
			<tr>
				<td align="left" class="CommonFormFieldName" nowrap="true">
					<CS:ResourceLabel runat="server" ResourceName="EmailNotificationDropDownList_When" />
				</td>
				<td align="left" class="CommonFormField">
					<CSD:EmailNotificationDropDownList id="ForumTrackingDDL" Runat="server" />
				</td>
			</tr>
			<tr>
				<td align="right" class="CommonFormField" colspan="2" nowrap="true">
					<asp:Button id="SortThreadsButton" runat="server" />
					<!-- Future version
					<asp:Button id="RememberSettingsButton" runat="server" />
					-->									
					<CSD:MarkAllRead runat="server" id="Markallread1" NAME="Markallread1" />
				</td>
			</tr>
		</table>
		
	</div>
</div>	
